// 菜品管理模块的接口
import request from '@/utils/request'
//品牌管理接口地址
enum API {
  //获取已有的菜品
  GET_DISH_PAGE = '/dish/page',
  UPDATE_ADD_DISH = '/dish',
  GET_CATEGORY_LIST = '/category/list',
}
//获取品牌的接口方法
//获取第几页的数据page
//limit 获取几个已有品牌数组
export const getDishPage = (page: number, pageSize: number) =>
  request.get(
    API.GET_DISH_PAGE + '?page=' + `${page}` + '&pageSize=' + `${pageSize}`,
  )

//添加菜品信息
export const reqAddDish = (data: any) => {
  return request.post<any, any>(API.UPDATE_ADD_DISH, data)
}
//更新菜品信息
export const reqUpdateDish = (data: any) => {
  return request.put<any, any>(API.UPDATE_ADD_DISH, data)
}
//删除菜品
export const reqDeleteDish = (data: any) => {
  return request.delete<any, any>(API.UPDATE_ADD_DISH + '?ids=' + data)
}
//获取菜品分类数据
export const reqGetCategoryList = () => {
  return request.get(API.GET_CATEGORY_LIST + '?type=1')
}
